package com.tpp.service;

import com.tpp.entity.CinemaInfo;
import com.tpp.entity.Film;
import com.tpp.mapper.CinemaMapper;
import com.tpp.mapper.FilmMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class CinemaService {
    @Autowired
    private CinemaMapper cinemaMapper;
    public String[]  FindCinemaByAddress(String address){
        String[]  cinemas =cinemaMapper.FindCinemaByAddress(address);
        return cinemas;
    }
    public CinemaInfo findCinemaByname(String name){
        return cinemaMapper.findCinemaByname(name);
    }

    public List<CinemaInfo> showAllCinemaByPlace(String place){
        return cinemaMapper.showAllCinemaByPlace(place+"%");
    }

    public List<CinemaInfo> showAllCinemaByDesc(){
        return cinemaMapper.showAllCinemaByDesc();
    }
    public List<CinemaInfo> showAllCinemaByAsc(){
        return cinemaMapper.showAllCinemaByAsc();
    }
    public List<String> showAllFilmNameByCinema(String cinema){
        return cinemaMapper.showAllFilmNameByCinema(cinema);
    }
    public Film findFilmInfo( String Film_name){
        return cinemaMapper.findFilmInfo(Film_name);
    }
    public Date[] FindAFilmTimeByFilmName(String cinema, String filmTitle){
        return cinemaMapper.FindAFilmTimeByFilmName(cinema,filmTitle);
    }

}
